﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;
using Manul.Genetics.Genom;
using Manul.Genetics.Character;

namespace Manul.Genetics
{
    [System.Xml.Serialization.XmlInclude(typeof(Manul.Genetics.Genom.GenomDirectory))]
    [System.Xml.Serialization.XmlInclude(typeof(Manul.Genetics.Genom.Locus))]
    [System.Xml.Serialization.XmlInclude(typeof(Manul.Genetics.Genom.Gen))]
    [System.Xml.Serialization.XmlInclude(typeof(Manul.Genetics.Character.CharacterDirectory))]
    [System.Xml.Serialization.XmlInclude(typeof(Manul.Genetics.Character.Character))]
    public class NamedItem
    {
        public NamedItem()
        {
            GUID = Guid.NewGuid().ToString();
        }
        public NamedItem(String name, String description) : this()
        {
            Name = name;
            Description = description;
        }

        public String Name
        { get; set; }
        public String Description
        { get; set; }

        public String GUID
        { get; set; }

        public override string ToString()
        {
            return this.Name;
        }

        public List<String> Labels = new List<String>();

        public virtual NamedItem FindByGuid(String guid)
        {
            return (this.GUID == guid) ? this : null;
        }
    }
}
